#include <iostream>
#include <string>
using namespace std;

int parseBinary(const string &binaryString)
{
  int value = binaryString[0] - '0';
  for (int i = 1; i < binaryString.length(); i++)
  {
    value = value * 2 + binaryString[i] - '0';
  }

  return value;
}


int main()
{
  cout << "Enter a bianry number: ";
  string bianryString;
  cin >> bianryString;
  cout << parseBinary(bianryString) << endl;

  return 0;
}
